package ch07;

/**
 * News 每日新闻类
 */
public class News {
    private String title;
    private String author;
    private String time;

    public News() {
    }

    public News(String title, String author, String time) {
        this.title = title;
        this.author = author;
        this.time = time;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof News == false) return false;
        News news2 = (News)obj;
        return news2.getTitle()==this.getTitle() && news2.getAuthor()==this.getAuthor();
    }

    @Override
    public String toString() {
        return "News{" +
                "title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", time='" + time + '\'' +
                '}';
    }
}
